package com.sunny.l79;

public class Solution {
    public int climbStairs(int n) {

        int n1 = 1;
        int n2 = 2;
        if(1 == n)
            return n1;
        if(2 == n)
            return n2;


        int res = 1;

        for(int i=3;i<=n;i++){
            res = n1+n2;
            n1 = n2;
            n2 = res;
        }

        return res;

    }
}
